<!DOCTYPE html >
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>项目结转编辑</title>

    <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/static/fonts/line-icons.css">
    <link href="/static/plugins/datatables/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css"/>
    <link href="/static/plugins/datatables/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css"/>
    <link href="/static/plugins/datatables/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/main.css">
    <link rel="stylesheet" type="text/css" href="/static/css/responsive.css">

</head>
<body>
<div class="app header-default side-nav-dark">
    <div class="layout">
        <!--顶部栏-->
        <div th:replace="~{/topbar::topbar}">
        </div>
        <!--侧边栏-->
        <div th:replace="~{/sidebar::sidebar}">
        </div>
        <!--主体部分-->
        <div class="page-container">

            <div class="main-content">
                <div class="container-fluid">

                    <div class="breadcrumb-wrapper row">
                        <div class="col-12 col-lg-3 col-md-6">
                            <h4 class="page-title">项目信息一览表</h4>
                        </div>
                    </div>

                </div>
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-md-12">
                            <span class="badge badge-default">项目结转</span>
                            <br>
                            <br>
                            <form  id="projectForm" method="post" onsubmit="return f()">
                                <div class="form-group">
                                    <label for="projectname" >
                                        项目名称：
                                    </label>
                                    <input type="text" class="form-control" name="name" id="projectname"
                                           th:value="${project.getName()}" style="width:300px; height:40px;"/>
                                    <input type="hidden"  id="id" name="id" th:value="${project.getId()}">
                                </div>
                                <div class="form-group">
                                    <label for="projectinstitution">
                                        所属单位：
                                    </label>
                                    <input type="text" class="form-control" name="institution" id="projectinstitution"
                                           th:value="${project.getInstitution()}" style="width:300px; height:40px;"/>
                                </div>
                                <div class="form-group">
                                    <label for="projectleader">
                                        负责人:
                                    </label>
                                    <input type="text" class="form-control" name="leader" id="projectleader"
                                           th:value="${project.getLeader()}" style="width:300px; height:40px;"/>
                                </div>
                                <div class="form-group">
                                    <label for="projectlid">
                                        个人账号id:
                                    </label>
                                    <input type="text" class="form-control" name="lid" id="projectlid"
                                           th:value="${project.getlId()}" style="width:300px; height:40px;"/>

                                    <label for="projectsid">
                                        学校账号id:
                                    </label>
                                    <input type="text" class="form-control" name="sid" id="projectsid"
                                           th:value="${project.getsId()}" style="width:300px; height:40px;"/>
                                </div>
                                <div class="form-group">
                                    <label for="projectmoney">
                                        结转金额:
                                    </label>
                                    <input type="text" class="form-control" name="money" id="projectmoney"
                                           th:value="${project.getMoney()}" style="width:300px; height:40px;"/>
                                </div>
                                <div class="form-group">
                                    <label for="projectdate">
                                        结转日期:
                                    </label>
                                    <input type="date" class="form-control" name="date" id="projectdate"
                                           th:value="${project.getDate()}" style="width:300px; height:40px;"/>
                                </div>
                                    <button type="submit" class="btn btn-primary" >提交</button>
                            </form>
                        </div>
                    </div>
                </div>
                <footer class="content-footer">
                    <div th:replace="~{/footer::footer}"></div>
                </footer>

            </div>

        </div>
    </div>
</div>
<script src="/static/js/jquery-min.js"></script>
<script src="/static/js/popper.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
<script src="/static/js/scripts.js"></script>
<script src="/static/js/jquery.app.js"></script>
<script src="/static/js/main.js"></script>

<script src="/static/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="/static/plugins/datatables/dataTables.bootstrap4.min.js"></script>

<script src="/static/plugins/datatables/dataTables.buttons.min.js"></script>
<script src="/static/plugins/datatables/buttons.bootstrap4.min.js"></script>
<script src="/static/plugins/datatables/jszip.min.js"></script>
<script src="/static/plugins/datatables/pdfmake.min.js"></script>
<script src="/static/plugins/datatables/vfs_fonts.js"></script>
<script src="/static/plugins/datatables/buttons.html5.min.js"></script>
<script src="/static/plugins/datatables/buttons.print.min.js"></script>
<script src="/static/plugins/datatables/buttons.colVis.min.js"></script>
<script src="/static/plugins/datatables/dataTables.responsive.min.js"></script>
<script src="/static/plugins/datatables/responsive.bootstrap4.min.js"></script>
<script src="/static/js/datatables.init.js"></script>

<script type="text/javascript">
    function f() {
        var formData = new FormData($('#projectForm')[0]);
        //formData.append("isChange","yes");
        $.ajax({
            url: "/project/addOperate1",
            type: "post",
            data: formData,
            processData: false,
            contentType: false,
            success: function (result) {
                if (result && result.success) {
                    alert("提交成功");
                    window.location.href = "/project/project_carried_over";
                } else {
                    alert(result.msg);
                }
            }
        });
        return false;
    }
</script>
</body>
</html>